#ifndef POSTMANAGERAPI_H
#define POSTMANAGERAPI_H

#include "Entity/DictData.h"
#include <QObject>
#include <QMainWindow>
#include <QtNetwork>
#include <QDebug>
#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <Utils.h>
#include <config.h>
#include <QMessageBox>

class PostManagerApi : public QObject
{
    Q_OBJECT
public:
    explicit PostManagerApi(QObject *parent = nullptr);
    //查询参数列表
    QByteArray* getList(int pageNum,int pageSize,QString postCode = "",
                        QString postName = "",QString status = "");
    QByteArray *editPost(int id,Post &post);
    QByteArray *deleteItems(QString ids);
    QByteArray *getById(int id);;

private:
    QString baseUrl ;
    QNetworkRequest request;
    QNetworkAccessManager *manager ;
    QByteArray *data = nullptr;
    Utils utils;
};

#endif // POSTMANAGERAPI_H
